{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'pyecharts'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "Input \u001b[1;32mIn [1]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mpyecharts\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m options \u001b[38;5;28;01mas\u001b[39;00m opts\n\u001b[0;32m      2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mpyecharts\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcharts\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Bar\n\u001b[0;32m      3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mpyecharts\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mfaker\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Faker \u001b[38;5;66;03m#伪数据生成包\u001b[39;00m\n",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'pyecharts'"
     ]
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "from pyecharts.faker import Faker #伪数据生成包\n",
    "from pyecharts.globals import CurrentConfig, OnlineHostType\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/v5/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"dc3d9d6d242640bab593c018e1647ffb\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_dc3d9d6d242640bab593c018e1647ffb = echarts.init(\n",
       "                    document.getElementById('dc3d9d6d242640bab593c018e1647ffb'), 'white', {renderer: 'canvas'});\n",
       "                var option_dc3d9d6d242640bab593c018e1647ffb = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"aria\": {\n",
       "        \"enabled\": false\n",
       "    },\n",
       "    \"color\": [\n",
       "        \"#5470c6\",\n",
       "        \"#91cc75\",\n",
       "        \"#fac858\",\n",
       "        \"#ee6666\",\n",
       "        \"#73c0de\",\n",
       "        \"#3ba272\",\n",
       "        \"#fc8452\",\n",
       "        \"#9a60b4\",\n",
       "        \"#ea7ccc\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u8fd9\\u662f\\u56fe\\u793a\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                23,\n",
       "                45,\n",
       "                15,\n",
       "                23,\n",
       "                56,\n",
       "                52,\n",
       "                25\n",
       "            ],\n",
       "            \"realtimeSort\": false,\n",
       "            \"showBackground\": false,\n",
       "            \"stackStrategy\": \"samesign\",\n",
       "            \"cursor\": \"pointer\",\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"itemStyle\": {\n",
       "                \"color\": \"pink\"\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u8fd9\\u662f\\u56fe\\u793a\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u8fd9\\u662f\\u56fe\\u793a\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"enterable\": false,\n",
       "        \"confine\": false,\n",
       "        \"appendToBody\": false,\n",
       "        \"transitionDuration\": 0.4,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5,\n",
       "        \"order\": \"seriesAsc\"\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u6cb3\\u9a6c\",\n",
       "                \"\\u87d2\\u86c7\",\n",
       "                \"\\u8001\\u864e\",\n",
       "                \"\\u5927\\u8c61\",\n",
       "                \"\\u5154\\u5b50\",\n",
       "                \"\\u718a\\u732b\",\n",
       "                \"\\u72ee\\u5b50\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_dc3d9d6d242640bab593c018e1647ffb.setOption(option_dc3d9d6d242640bab593c018e1647ffb);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ea039589d0>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y = [23,45,15,23,56,52,25]\n",
    "x = Faker.choose()# 生成伪数据\n",
    "bar = Bar() # 生成Bar 图对象\n",
    "bar.add_xaxis(x) #添加设置x轴\n",
    "# pyecharts 要求的数据必须是 python 的基础数据类型 list\n",
    "bar.add_yaxis('这是图示',y,itemstyle_opts=opts.ItemStyleOpts(color='pink'))\n",
    "bar.render('bar.html')\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['周一', '周二', '周三', '周四', '周五', '周六', '周日']\n"
     ]
    }
   ],
   "source": [
    "Faker.choose()\n",
    "print(Faker.choose())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/v5/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"f74c20affd4c43c79b91348647c9c5b5\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_f74c20affd4c43c79b91348647c9c5b5 = echarts.init(\n",
       "                    document.getElementById('f74c20affd4c43c79b91348647c9c5b5'), 'white', {renderer: 'canvas'});\n",
       "                var option_f74c20affd4c43c79b91348647c9c5b5 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"aria\": {\n",
       "        \"enabled\": false\n",
       "    },\n",
       "    \"color\": [\n",
       "        \"#5470c6\",\n",
       "        \"#91cc75\",\n",
       "        \"#fac858\",\n",
       "        \"#ee6666\",\n",
       "        \"#73c0de\",\n",
       "        \"#3ba272\",\n",
       "        \"#fc8452\",\n",
       "        \"#9a60b4\",\n",
       "        \"#ea7ccc\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u6570\\u636e\\u540d\\u79f0\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                10,\n",
       "                32,\n",
       "                36,\n",
       "                23,\n",
       "                56,\n",
       "                52,\n",
       "                22\n",
       "            ],\n",
       "            \"realtimeSort\": false,\n",
       "            \"showBackground\": false,\n",
       "            \"stackStrategy\": \"samesign\",\n",
       "            \"cursor\": \"pointer\",\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5927\\u503c\",\n",
       "                        \"type\": \"max\"\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5c0f\\u503c\",\n",
       "                        \"type\": \"min\"\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u5e73\\u5747\\u503c\",\n",
       "                        \"type\": \"average\"\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"itemStyle\": {\n",
       "                \"color\": \"red\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u6570\\u636e\\u540d\\u79f0\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u6570\\u636e\\u540d\\u79f0\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1,\n",
       "            \"borderRadius\": 0,\n",
       "            \"pageButtonItemGap\": 5,\n",
       "            \"pageButtonPosition\": \"end\",\n",
       "            \"pageFormatter\": \"{current}/{total}\",\n",
       "            \"pageIconColor\": \"#2f4554\",\n",
       "            \"pageIconInactiveColor\": \"#aaa\",\n",
       "            \"pageIconSize\": 15,\n",
       "            \"animationDurationUpdate\": 800,\n",
       "            \"selector\": false,\n",
       "            \"selectorPosition\": \"auto\",\n",
       "            \"selectorItemGap\": 7,\n",
       "            \"selectorButtonGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"enterable\": false,\n",
       "        \"confine\": false,\n",
       "        \"appendToBody\": false,\n",
       "        \"transitionDuration\": 0.4,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5,\n",
       "        \"order\": \"seriesAsc\"\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"type\": \"category\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u8349\\u8393\",\n",
       "                \"\\u8292\\u679c\",\n",
       "                \"\\u8461\\u8404\",\n",
       "                \"\\u96ea\\u68a8\",\n",
       "                \"\\u897f\\u74dc\",\n",
       "                \"\\u67e0\\u6aac\",\n",
       "                \"\\u8f66\\u5398\\u5b50\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"text\": \"\\u8fd9\\u662f\\u6807\\u9898\",\n",
       "            \"target\": \"blank\",\n",
       "            \"subtarget\": \"blank\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"textAlign\": \"auto\",\n",
       "            \"textVerticalAlign\": \"auto\",\n",
       "            \"triggerEvent\": false\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"slider\",\n",
       "        \"showDetail\": true,\n",
       "        \"showDataShadow\": true,\n",
       "        \"realtime\": true,\n",
       "        \"start\": 20,\n",
       "        \"end\": 80,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"zoomLock\": false,\n",
       "        \"filterMode\": \"filter\"\n",
       "    }\n",
       "};\n",
       "                chart_f74c20affd4c43c79b91348647c9c5b5.setOption(option_f74c20affd4c43c79b91348647c9c5b5);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ea039b8a00>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x = Faker.choose()# 生成伪数据\n",
    "y = [10,32,36,23,56,52,22]\n",
    "bar = Bar()\n",
    "bar.add_xaxis(x)\n",
    "bar.add_yaxis('数据名称',y,)\n",
    "\n",
    "##全局配置\n",
    "bar.set_global_opts(\n",
    "    datazoom_opts = opts.DataZoomOpts(is_show=True),\n",
    "    title_opts = opts.TitleOpts(title='这是标题'),\n",
    "    #visualmap_opts = opts.VisualMapOpts(is_show=True),\n",
    "    xaxis_opts = opts.AxisOpts(type_='category')\n",
    ")\n",
    "\n",
    "##系列配置项\n",
    "bar.set_series_opts(\n",
    "    label_opts=opts.LabelOpts(is_show=False),\n",
    "    markpoint_opts=opts.MarkPointOpts(\n",
    "        data=[\n",
    "            opts.MarkPointItem(type_='max',name='最大值'), #继承了MarkPointItem 类\n",
    "            opts.MarkPointItem(type_='min',name='最小值'), #\n",
    "            opts.MarkPointItem(type_='average',name='平均值') #\n",
    "        ]\n",
    "    ),\n",
    "    itemstyle_opts=opts.ItemStyleOpts(color='red')\n",
    ")\n",
    "\n",
    "bar.render('全局配置.html')\n",
    "bar.render_notebook()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/v5/echarts.min', 'purple-passion':'https://assets.pyecharts.org/assets/v5/themes/purple-passion'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"05684849f7b644ae85c61f17d9bb5f66\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'purple-passion'], function(echarts) {\n",
       "                var chart_05684849f7b644ae85c61f17d9bb5f66 = echarts.init(\n",
       "                    document.getElementById('05684849f7b644ae85c61f17d9bb5f66'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_05684849f7b644ae85c61f17d9bb5f66 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"aria\": {\n",
       "        \"enabled\": false\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u8fd9\\u662f\\u56fe\\u793a\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                23,\n",
       "                45,\n",
       "                15,\n",
       "                23,\n",
       "                56,\n",
       "                52,\n",
       "                25\n",
       "            ],\n",
       "            \"realtimeSort\": false,\n",
       "            \"showBackground\": false,\n",
       "            \"stackStrategy\": \"samesign\",\n",
       "            \"cursor\": \"pointer\",\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u8fd9\\u662f\\u56fe\\u793a\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u8fd9\\u662f\\u56fe\\u793a\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"enterable\": false,\n",
       "        \"confine\": false,\n",
       "        \"appendToBody\": false,\n",
       "        \"transitionDuration\": 0.4,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5,\n",
       "        \"order\": \"seriesAsc\"\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5c0f\\u7c73\",\n",
       "                \"\\u4e09\\u661f\",\n",
       "                \"\\u534e\\u4e3a\",\n",
       "                \"\\u82f9\\u679c\",\n",
       "                \"\\u9b45\\u65cf\",\n",
       "                \"VIVO\",\n",
       "                \"OPPO\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_05684849f7b644ae85c61f17d9bb5f66.setOption(option_05684849f7b644ae85c61f17d9bb5f66);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ea01ffbfd0>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.globals import ThemeType\n",
    "#LIGHT DARK CHALK ESSON PURPLE_PASSION\n",
    "y = [23,45,15,23,56,52,25]\n",
    "x = Faker.choose()# 生成伪数据\n",
    "bar = Bar(init_opts=opts.InitOpts(theme=ThemeType.PURPLE_PASSION)) # 生成Bar 图对象\n",
    "bar.add_xaxis(x) #添加设置x轴\n",
    "# pyecharts 要求的数据必须是 python 的基础数据类型 list\n",
    "bar.add_yaxis('这是图示',y)\n",
    "bar.render('主题样式.html')\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/v5/echarts.min', 'purple-passion':'https://assets.pyecharts.org/assets/v5/themes/purple-passion'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"0e2eebba23a14f978d1b4ca4968e9125\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'purple-passion'], function(echarts) {\n",
       "                var chart_0e2eebba23a14f978d1b4ca4968e9125 = echarts.init(\n",
       "                    document.getElementById('0e2eebba23a14f978d1b4ca4968e9125'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_0e2eebba23a14f978d1b4ca4968e9125 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"aria\": {\n",
       "        \"enabled\": false\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u7ec4\\u522b1\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                11,\n",
       "                22,\n",
       "                33,\n",
       "                54,\n",
       "                62,\n",
       "                15,\n",
       "                75\n",
       "            ],\n",
       "            \"realtimeSort\": false,\n",
       "            \"showBackground\": false,\n",
       "            \"stackStrategy\": \"samesign\",\n",
       "            \"cursor\": \"pointer\",\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u7ec4\\u522b2\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                20,\n",
       "                23,\n",
       "                51,\n",
       "                48,\n",
       "                85,\n",
       "                31,\n",
       "                32\n",
       "            ],\n",
       "            \"realtimeSort\": false,\n",
       "            \"showBackground\": false,\n",
       "            \"stackStrategy\": \"samesign\",\n",
       "            \"cursor\": \"pointer\",\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u7ec4\\u522b1\",\n",
       "                \"\\u7ec4\\u522b2\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u7ec4\\u522b1\": true,\n",
       "                \"\\u7ec4\\u522b2\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"enterable\": false,\n",
       "        \"confine\": false,\n",
       "        \"appendToBody\": false,\n",
       "        \"transitionDuration\": 0.4,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5,\n",
       "        \"order\": \"seriesAsc\"\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5468\\u4e00\",\n",
       "                \"\\u5468\\u4e8c\",\n",
       "                \"\\u5468\\u4e09\",\n",
       "                \"\\u5468\\u56db\",\n",
       "                \"\\u5468\\u4e94\",\n",
       "                \"\\u5468\\u516d\",\n",
       "                \"\\u5468\\u65e5\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_0e2eebba23a14f978d1b4ca4968e9125.setOption(option_0e2eebba23a14f978d1b4ca4968e9125);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ea03948a60>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x = Faker.choose()# 生成伪数据\n",
    "y1 = [11,22,33,54,62,15,75]\n",
    "y2 = [20,23,51,48,85,31,32]\n",
    "bar = Bar(init_opts=opts.InitOpts(theme=ThemeType.PURPLE_PASSION))\n",
    "bar.add_xaxis(x)\n",
    "bar.add_yaxis('组别1',y1)\n",
    "bar.add_yaxis('组别2',y2)\n",
    "bar.render_notebook()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/v5/echarts.min', 'purple-passion':'https://assets.pyecharts.org/assets/v5/themes/purple-passion'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"e2d4c88b48e546c0871b965635741ac2\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'purple-passion'], function(echarts) {\n",
       "                var chart_e2d4c88b48e546c0871b965635741ac2 = echarts.init(\n",
       "                    document.getElementById('e2d4c88b48e546c0871b965635741ac2'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_e2d4c88b48e546c0871b965635741ac2 = {\n",
       "    \"baseOption\": {\n",
       "        \"series\": [\n",
       "            {\n",
       "                \"type\": \"bar\",\n",
       "                \"name\": \"2022\",\n",
       "                \"legendHoverLink\": true,\n",
       "                \"data\": [\n",
       "                    52,\n",
       "                    33,\n",
       "                    55,\n",
       "                    66,\n",
       "                    22,\n",
       "                    88,\n",
       "                    33\n",
       "                ],\n",
       "                \"realtimeSort\": false,\n",
       "                \"showBackground\": false,\n",
       "                \"stackStrategy\": \"samesign\",\n",
       "                \"cursor\": \"pointer\",\n",
       "                \"barMinHeight\": 0,\n",
       "                \"barCategoryGap\": \"20%\",\n",
       "                \"barGap\": \"30%\",\n",
       "                \"large\": false,\n",
       "                \"largeThreshold\": 400,\n",
       "                \"seriesLayoutBy\": \"column\",\n",
       "                \"datasetIndex\": 0,\n",
       "                \"clip\": true,\n",
       "                \"zlevel\": 0,\n",
       "                \"z\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            }\n",
       "        ],\n",
       "        \"timeline\": {\n",
       "            \"axisType\": \"category\",\n",
       "            \"currentIndex\": 0,\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"autoPlay\": false,\n",
       "            \"controlPosition\": \"left\",\n",
       "            \"loop\": true,\n",
       "            \"rewind\": false,\n",
       "            \"show\": true,\n",
       "            \"inverse\": false,\n",
       "            \"bottom\": \"-5px\",\n",
       "            \"progress\": {},\n",
       "            \"data\": [\n",
       "                \"2020\\u5e74\",\n",
       "                \"2021\\u5e74\",\n",
       "                \"2022\\u5e74\"\n",
       "            ]\n",
       "        },\n",
       "        \"xAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": true,\n",
       "                    \"lineStyle\": {\n",
       "                        \"show\": true,\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                },\n",
       "                \"data\": [\n",
       "                    \"\\u6cb3\\u9a6c\",\n",
       "                    \"\\u87d2\\u86c7\",\n",
       "                    \"\\u8001\\u864e\",\n",
       "                    \"\\u5927\\u8c61\",\n",
       "                    \"\\u5154\\u5b50\",\n",
       "                    \"\\u718a\\u732b\",\n",
       "                    \"\\u72ee\\u5b50\"\n",
       "                ]\n",
       "            }\n",
       "        ],\n",
       "        \"yAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": true,\n",
       "                    \"lineStyle\": {\n",
       "                        \"show\": true,\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        ]\n",
       "    },\n",
       "    \"options\": [\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"2020\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"2020\": true\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"type\": \"bar\",\n",
       "                    \"name\": \"2020\",\n",
       "                    \"legendHoverLink\": true,\n",
       "                    \"data\": [\n",
       "                        11,\n",
       "                        22,\n",
       "                        33,\n",
       "                        54,\n",
       "                        62,\n",
       "                        15,\n",
       "                        75\n",
       "                    ],\n",
       "                    \"realtimeSort\": false,\n",
       "                    \"showBackground\": false,\n",
       "                    \"stackStrategy\": \"samesign\",\n",
       "                    \"cursor\": \"pointer\",\n",
       "                    \"barMinHeight\": 0,\n",
       "                    \"barCategoryGap\": \"20%\",\n",
       "                    \"barGap\": \"30%\",\n",
       "                    \"large\": false,\n",
       "                    \"largeThreshold\": 400,\n",
       "                    \"seriesLayoutBy\": \"column\",\n",
       "                    \"datasetIndex\": 0,\n",
       "                    \"clip\": true,\n",
       "                    \"zlevel\": 0,\n",
       "                    \"z\": 2,\n",
       "                    \"label\": {\n",
       "                        \"show\": true,\n",
       "                        \"margin\": 8\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": true,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u6cb3\\u9a6c\",\n",
       "                        \"\\u87d2\\u86c7\",\n",
       "                        \"\\u8001\\u864e\",\n",
       "                        \"\\u5927\\u8c61\",\n",
       "                        \"\\u5154\\u5b50\",\n",
       "                        \"\\u718a\\u732b\",\n",
       "                        \"\\u72ee\\u5b50\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"yAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": true,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"enterable\": false,\n",
       "                \"confine\": false,\n",
       "                \"appendToBody\": false,\n",
       "                \"transitionDuration\": 0.4,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5,\n",
       "                \"order\": \"seriesAsc\"\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#5470c6\",\n",
       "                \"#91cc75\",\n",
       "                \"#fac858\",\n",
       "                \"#ee6666\",\n",
       "                \"#73c0de\",\n",
       "                \"#3ba272\",\n",
       "                \"#fc8452\",\n",
       "                \"#9a60b4\",\n",
       "                \"#ea7ccc\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"2021\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"2021\": true\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"type\": \"bar\",\n",
       "                    \"name\": \"2021\",\n",
       "                    \"legendHoverLink\": true,\n",
       "                    \"data\": [\n",
       "                        20,\n",
       "                        23,\n",
       "                        51,\n",
       "                        48,\n",
       "                        85,\n",
       "                        31,\n",
       "                        32\n",
       "                    ],\n",
       "                    \"realtimeSort\": false,\n",
       "                    \"showBackground\": false,\n",
       "                    \"stackStrategy\": \"samesign\",\n",
       "                    \"cursor\": \"pointer\",\n",
       "                    \"barMinHeight\": 0,\n",
       "                    \"barCategoryGap\": \"20%\",\n",
       "                    \"barGap\": \"30%\",\n",
       "                    \"large\": false,\n",
       "                    \"largeThreshold\": 400,\n",
       "                    \"seriesLayoutBy\": \"column\",\n",
       "                    \"datasetIndex\": 0,\n",
       "                    \"clip\": true,\n",
       "                    \"zlevel\": 0,\n",
       "                    \"z\": 2,\n",
       "                    \"label\": {\n",
       "                        \"show\": true,\n",
       "                        \"margin\": 8\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": true,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u6cb3\\u9a6c\",\n",
       "                        \"\\u87d2\\u86c7\",\n",
       "                        \"\\u8001\\u864e\",\n",
       "                        \"\\u5927\\u8c61\",\n",
       "                        \"\\u5154\\u5b50\",\n",
       "                        \"\\u718a\\u732b\",\n",
       "                        \"\\u72ee\\u5b50\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"yAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": true,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"enterable\": false,\n",
       "                \"confine\": false,\n",
       "                \"appendToBody\": false,\n",
       "                \"transitionDuration\": 0.4,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5,\n",
       "                \"order\": \"seriesAsc\"\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#5470c6\",\n",
       "                \"#91cc75\",\n",
       "                \"#fac858\",\n",
       "                \"#ee6666\",\n",
       "                \"#73c0de\",\n",
       "                \"#3ba272\",\n",
       "                \"#fc8452\",\n",
       "                \"#9a60b4\",\n",
       "                \"#ea7ccc\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"2022\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"2022\": true\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"type\": \"bar\",\n",
       "                    \"name\": \"2022\",\n",
       "                    \"legendHoverLink\": true,\n",
       "                    \"data\": [\n",
       "                        52,\n",
       "                        33,\n",
       "                        55,\n",
       "                        66,\n",
       "                        22,\n",
       "                        88,\n",
       "                        33\n",
       "                    ],\n",
       "                    \"realtimeSort\": false,\n",
       "                    \"showBackground\": false,\n",
       "                    \"stackStrategy\": \"samesign\",\n",
       "                    \"cursor\": \"pointer\",\n",
       "                    \"barMinHeight\": 0,\n",
       "                    \"barCategoryGap\": \"20%\",\n",
       "                    \"barGap\": \"30%\",\n",
       "                    \"large\": false,\n",
       "                    \"largeThreshold\": 400,\n",
       "                    \"seriesLayoutBy\": \"column\",\n",
       "                    \"datasetIndex\": 0,\n",
       "                    \"clip\": true,\n",
       "                    \"zlevel\": 0,\n",
       "                    \"z\": 2,\n",
       "                    \"label\": {\n",
       "                        \"show\": true,\n",
       "                        \"margin\": 8\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": true,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u6cb3\\u9a6c\",\n",
       "                        \"\\u87d2\\u86c7\",\n",
       "                        \"\\u8001\\u864e\",\n",
       "                        \"\\u5927\\u8c61\",\n",
       "                        \"\\u5154\\u5b50\",\n",
       "                        \"\\u718a\\u732b\",\n",
       "                        \"\\u72ee\\u5b50\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"yAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": true,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"enterable\": false,\n",
       "                \"confine\": false,\n",
       "                \"appendToBody\": false,\n",
       "                \"transitionDuration\": 0.4,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5,\n",
       "                \"order\": \"seriesAsc\"\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#5470c6\",\n",
       "                \"#91cc75\",\n",
       "                \"#fac858\",\n",
       "                \"#ee6666\",\n",
       "                \"#73c0de\",\n",
       "                \"#3ba272\",\n",
       "                \"#fc8452\",\n",
       "                \"#9a60b4\",\n",
       "                \"#ea7ccc\"\n",
       "            ]\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_e2d4c88b48e546c0871b965635741ac2.setOption(option_e2d4c88b48e546c0871b965635741ac2);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ea0239c640>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "from pyecharts.faker import Faker #伪数据生成包\n",
    "from pyecharts.charts import Timeline\n",
    "\n",
    "xx = Faker.choose()# 生成伪数据\n",
    "yy1 = [11,22,33,54,62,15,75]\n",
    "yy2 = [20,23,51,48,85,31,32]\n",
    "yy3 = [52,33,55,66,22,88,33]\n",
    "\n",
    "bar1 = Bar()\n",
    "bar1.add_xaxis(xx)\n",
    "bar1.add_yaxis('2020',yy1)\n",
    "\n",
    "bar2 = Bar()\n",
    "bar2.add_xaxis(xx)\n",
    "bar2.add_yaxis('2021',yy2)\n",
    "\n",
    "bar3 = Bar()\n",
    "bar3.add_xaxis(xx)\n",
    "bar3.add_yaxis('2022',yy3)\n",
    "\n",
    "\n",
    "t1 = Timeline(init_opts=opts.InitOpts(theme=ThemeType.PURPLE_PASSION))\n",
    "t1.add(bar1,'2020年')\n",
    "t1.add(bar2,'2021年')\n",
    "t1.add(bar3,'2022年')\n",
    "\n",
    "t1.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/v5/echarts.min', 'echarts-gl':'https://assets.pyecharts.org/assets/v5/echarts-gl.min', 'purple-passion':'https://assets.pyecharts.org/assets/v5/themes/purple-passion'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"e5d7b761b5a54a07ae6e4926cedd22ad\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'echarts-gl', 'purple-passion'], function(echarts) {\n",
       "                var chart_e5d7b761b5a54a07ae6e4926cedd22ad = echarts.init(\n",
       "                    document.getElementById('e5d7b761b5a54a07ae6e4926cedd22ad'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_e5d7b761b5a54a07ae6e4926cedd22ad = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"aria\": {\n",
       "        \"enabled\": false\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar3D\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    0,\n",
       "                    74\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    0,\n",
       "                    95\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    0,\n",
       "                    33\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    0,\n",
       "                    20\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    0,\n",
       "                    92\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    0,\n",
       "                    23\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    0,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    0,\n",
       "                    26\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    0,\n",
       "                    114\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    0,\n",
       "                    101\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    0,\n",
       "                    106\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    0,\n",
       "                    118\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    0,\n",
       "                    104\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    0,\n",
       "                    77\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    0,\n",
       "                    88\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    0,\n",
       "                    15\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    0,\n",
       "                    112\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    0,\n",
       "                    115\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    0,\n",
       "                    60\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    0,\n",
       "                    57\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    0,\n",
       "                    59\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    0,\n",
       "                    28\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    0,\n",
       "                    24\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    0,\n",
       "                    45\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    1,\n",
       "                    36\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    1,\n",
       "                    108\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    1,\n",
       "                    105\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    1,\n",
       "                    42\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    1,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    1,\n",
       "                    106\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    1,\n",
       "                    104\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    1,\n",
       "                    92\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    1,\n",
       "                    83\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    1,\n",
       "                    33\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    1,\n",
       "                    45\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    1,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    1,\n",
       "                    48\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    1,\n",
       "                    95\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    1,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    1,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    1,\n",
       "                    68\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    1,\n",
       "                    13\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    1,\n",
       "                    38\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    1,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    1,\n",
       "                    53\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    1,\n",
       "                    49\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    1,\n",
       "                    68\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    1,\n",
       "                    87\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    2,\n",
       "                    75\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    2,\n",
       "                    27\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    2,\n",
       "                    86\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    2,\n",
       "                    26\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    2,\n",
       "                    119\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    2,\n",
       "                    96\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    2,\n",
       "                    118\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    2,\n",
       "                    70\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    2,\n",
       "                    79\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    2,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    2,\n",
       "                    86\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    2,\n",
       "                    83\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    2,\n",
       "                    79\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    2,\n",
       "                    81\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    2,\n",
       "                    50\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    2,\n",
       "                    80\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    2,\n",
       "                    28\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    2,\n",
       "                    67\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    2,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    2,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    2,\n",
       "                    75\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    2,\n",
       "                    95\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    2,\n",
       "                    16\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    2,\n",
       "                    95\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    3,\n",
       "                    120\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    3,\n",
       "                    97\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    3,\n",
       "                    78\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    3,\n",
       "                    100\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    3,\n",
       "                    16\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    3,\n",
       "                    33\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    3,\n",
       "                    41\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    3,\n",
       "                    56\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    3,\n",
       "                    31\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    3,\n",
       "                    22\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    3,\n",
       "                    112\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    3,\n",
       "                    80\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    3,\n",
       "                    46\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    3,\n",
       "                    88\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    3,\n",
       "                    30\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    3,\n",
       "                    15\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    3,\n",
       "                    119\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    3,\n",
       "                    97\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    3,\n",
       "                    69\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    3,\n",
       "                    108\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    3,\n",
       "                    110\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    3,\n",
       "                    33\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    3,\n",
       "                    63\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    3,\n",
       "                    110\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    4,\n",
       "                    29\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    4,\n",
       "                    70\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    4,\n",
       "                    40\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    4,\n",
       "                    61\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    4,\n",
       "                    67\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    4,\n",
       "                    89\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    4,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    4,\n",
       "                    39\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    4,\n",
       "                    48\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    4,\n",
       "                    79\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    4,\n",
       "                    101\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    4,\n",
       "                    103\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    4,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    4,\n",
       "                    69\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    4,\n",
       "                    107\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    4,\n",
       "                    58\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    4,\n",
       "                    99\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    4,\n",
       "                    65\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    4,\n",
       "                    58\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    4,\n",
       "                    30\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    4,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    4,\n",
       "                    75\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    4,\n",
       "                    24\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    4,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    5,\n",
       "                    51\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    5,\n",
       "                    22\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    5,\n",
       "                    45\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    5,\n",
       "                    97\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    5,\n",
       "                    18\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    5,\n",
       "                    109\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    5,\n",
       "                    81\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    5,\n",
       "                    23\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    5,\n",
       "                    68\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    5,\n",
       "                    25\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    5,\n",
       "                    49\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    5,\n",
       "                    108\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    5,\n",
       "                    104\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    5,\n",
       "                    117\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    5,\n",
       "                    43\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    5,\n",
       "                    52\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    5,\n",
       "                    33\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    5,\n",
       "                    17\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    5,\n",
       "                    74\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    5,\n",
       "                    74\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    5,\n",
       "                    36\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    5,\n",
       "                    54\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    5,\n",
       "                    40\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    5,\n",
       "                    111\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    6,\n",
       "                    35\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    6,\n",
       "                    53\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    6,\n",
       "                    36\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    6,\n",
       "                    64\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    6,\n",
       "                    92\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    6,\n",
       "                    57\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    6,\n",
       "                    97\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    6,\n",
       "                    57\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    6,\n",
       "                    109\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    6,\n",
       "                    43\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    6,\n",
       "                    89\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    6,\n",
       "                    72\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    6,\n",
       "                    67\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    6,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    6,\n",
       "                    22\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    6,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    6,\n",
       "                    29\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    6,\n",
       "                    33\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    6,\n",
       "                    90\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    6,\n",
       "                    103\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    6,\n",
       "                    59\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    6,\n",
       "                    37\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    6,\n",
       "                    71\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    6,\n",
       "                    100\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"grid3DIndex\": 0\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"enterable\": false,\n",
       "        \"confine\": false,\n",
       "        \"appendToBody\": false,\n",
       "        \"transitionDuration\": 0.4,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5,\n",
       "        \"order\": \"seriesAsc\"\n",
       "    },\n",
       "    \"xAxis3D\": {\n",
       "        \"data\": [\n",
       "            \"12a\",\n",
       "            \"1a\",\n",
       "            \"2a\",\n",
       "            \"3a\",\n",
       "            \"4a\",\n",
       "            \"5a\",\n",
       "            \"6a\",\n",
       "            \"7a\",\n",
       "            \"8a\",\n",
       "            \"9a\",\n",
       "            \"10a\",\n",
       "            \"11a\",\n",
       "            \"12p\",\n",
       "            \"1p\",\n",
       "            \"2p\",\n",
       "            \"3p\",\n",
       "            \"4p\",\n",
       "            \"5p\",\n",
       "            \"6p\",\n",
       "            \"7p\",\n",
       "            \"8p\",\n",
       "            \"9p\",\n",
       "            \"10p\",\n",
       "            \"11p\"\n",
       "        ],\n",
       "        \"show\": true,\n",
       "        \"scale\": false,\n",
       "        \"grid3DIndex\": 0,\n",
       "        \"nameGap\": 20,\n",
       "        \"logBase\": 10,\n",
       "        \"type\": \"category\",\n",
       "        \"splitLine\": {\n",
       "            \"show\": true,\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"yAxis3D\": {\n",
       "        \"data\": [\n",
       "            \"Saturday\",\n",
       "            \"Friday\",\n",
       "            \"Thursday\",\n",
       "            \"Wednesday\",\n",
       "            \"Tuesday\",\n",
       "            \"Monday\",\n",
       "            \"Sunday\"\n",
       "        ],\n",
       "        \"show\": true,\n",
       "        \"scale\": false,\n",
       "        \"grid3DIndex\": 0,\n",
       "        \"nameGap\": 20,\n",
       "        \"logBase\": 10,\n",
       "        \"type\": \"category\",\n",
       "        \"splitLine\": {\n",
       "            \"show\": true,\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"zAxis3D\": {\n",
       "        \"show\": true,\n",
       "        \"scale\": false,\n",
       "        \"grid3DIndex\": 0,\n",
       "        \"nameGap\": 20,\n",
       "        \"logBase\": 10,\n",
       "        \"type\": \"value\",\n",
       "        \"splitLine\": {\n",
       "            \"show\": true,\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"grid3D\": {\n",
       "        \"boxWidth\": 200,\n",
       "        \"boxHeight\": 100,\n",
       "        \"boxDepth\": 80,\n",
       "        \"splitLine\": {\n",
       "            \"show\": true,\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            }\n",
       "        },\n",
       "        \"environment\": \"auto\",\n",
       "        \"viewControl\": {\n",
       "            \"autoRotate\": false,\n",
       "            \"autoRotateSpeed\": 10,\n",
       "            \"rotateSensitivity\": 1,\n",
       "            \"alpha\": 20,\n",
       "            \"beta\": 40,\n",
       "            \"minAlpha\": -90,\n",
       "            \"maxAlpha\": 90\n",
       "        },\n",
       "        \"zlevel\": -10,\n",
       "        \"left\": \"auto\",\n",
       "        \"top\": \"auto\",\n",
       "        \"right\": \"auto\",\n",
       "        \"bottom\": \"auto\"\n",
       "    }\n",
       "};\n",
       "                chart_e5d7b761b5a54a07ae6e4926cedd22ad.setOption(option_e5d7b761b5a54a07ae6e4926cedd22ad);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ea039b8490>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.faker import Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar3D\n",
    "import random\n",
    "\n",
    "x = Faker.clock\n",
    "y = Faker.week_en\n",
    "\n",
    "data = [[i,j,random.randint(0,120)] for i in range(7) for j in range(24)]\n",
    "data = [[d[1],d[0],d[2]] for d in data] # m默认的第一个(y,x,z) 所以x 和y 要调换\n",
    "\n",
    " #第一个元素是x坐标的索引，第二个坐标是y的索引，z为数值\n",
    "bar3d = Bar3D(init_opts=opts.InitOpts(theme=ThemeType.PURPLE_PASSION))\n",
    "bar3d.add(\n",
    "    series_name='',\n",
    "    data=data,\n",
    "    xaxis3d_opts=opts.Axis3DOpts(x,type_='category'),\n",
    "    yaxis3d_opts=opts.Axis3DOpts(y,type_='category'),\n",
    "    zaxis3d_opts=opts.Axis3DOpts(type_='value')\n",
    ")\n",
    "\n",
    "bar3d.render_notebook()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[('广东省', 92), ('北京市', 47), ('上海市', 29), ('江西省', 131), ('湖南省', 77), ('浙江省', 105), ('江苏省', 95)]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/v5/echarts.min', 'china':'https://assets.pyecharts.org/assets/v5/maps/china', 'romantic':'https://assets.pyecharts.org/assets/v5/themes/romantic'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"f5fbeced2f5d475ea4f9e3fcb6d02f7d\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china', 'romantic'], function(echarts) {\n",
       "                var chart_f5fbeced2f5d475ea4f9e3fcb6d02f7d = echarts.init(\n",
       "                    document.getElementById('f5fbeced2f5d475ea4f9e3fcb6d02f7d'), 'romantic', {renderer: 'canvas'});\n",
       "                var option_f5fbeced2f5d475ea4f9e3fcb6d02f7d = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"aria\": {\n",
       "        \"enabled\": false\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"\\u56fe\\u4f8b\\u540d\\u79f0\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"symbolSize\": 12,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\\u7701\",\n",
       "                    \"value\": [\n",
       "                        113.26653,\n",
       "                        23.132191,\n",
       "                        92\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\\u5e02\",\n",
       "                    \"value\": [\n",
       "                        116.4,\n",
       "                        39.9,\n",
       "                        47\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\\u5e02\",\n",
       "                    \"value\": [\n",
       "                        121.47,\n",
       "                        31.23,\n",
       "                        29\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\\u7701\",\n",
       "                    \"value\": [\n",
       "                        115.909228,\n",
       "                        28.675696,\n",
       "                        131\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\\u7701\",\n",
       "                    \"value\": [\n",
       "                        112.98381,\n",
       "                        28.112444,\n",
       "                        77\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\\u7701\",\n",
       "                    \"value\": [\n",
       "                        120.152791,\n",
       "                        30.267446,\n",
       "                        105\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\\u7701\",\n",
       "                    \"value\": [\n",
       "                        118.763232,\n",
       "                        32.061707,\n",
       "                        95\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u56fe\\u4f8b\\u540d\\u79f0\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u56fe\\u4f8b\\u540d\\u79f0\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1,\n",
       "            \"borderRadius\": 0,\n",
       "            \"pageButtonItemGap\": 5,\n",
       "            \"pageButtonPosition\": \"end\",\n",
       "            \"pageFormatter\": \"{current}/{total}\",\n",
       "            \"pageIconColor\": \"#2f4554\",\n",
       "            \"pageIconInactiveColor\": \"#aaa\",\n",
       "            \"pageIconSize\": 15,\n",
       "            \"animationDurationUpdate\": 800,\n",
       "            \"selector\": false,\n",
       "            \"selectorPosition\": \"auto\",\n",
       "            \"selectorItemGap\": 7,\n",
       "            \"selectorButtonGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"enterable\": false,\n",
       "        \"confine\": false,\n",
       "        \"appendToBody\": false,\n",
       "        \"transitionDuration\": 0.4,\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5,\n",
       "        \"order\": \"seriesAsc\"\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"text\": \"\\u8fd9\\u662f\\u6807\\u9898\",\n",
       "            \"target\": \"blank\",\n",
       "            \"subtarget\": \"blank\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"textAlign\": \"auto\",\n",
       "            \"textVerticalAlign\": \"auto\",\n",
       "            \"triggerEvent\": false\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"piecewise\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 200,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"hoverLink\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"padding\": 5,\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 14,\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"geo\": {\n",
       "        \"map\": \"china\",\n",
       "        \"roam\": true,\n",
       "        \"aspectScale\": 0.75,\n",
       "        \"nameProperty\": \"name\",\n",
       "        \"selectedMode\": false,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_f5fbeced2f5d475ea4f9e3fcb6d02f7d.setOption(option_f5fbeced2f5d475ea4f9e3fcb6d02f7d);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ea03948b50>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.faker import Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Geo\n",
    "\n",
    "data = [ z for z in zip(Faker.provinces,Faker.values())]\n",
    "print(data)\n",
    "\n",
    "map = Geo(init_opts=opts.InitOpts(theme=ThemeType.ROMANTIC))\n",
    "map.add_schema(maptype='china')\n",
    "map.add(\n",
    "    '图例名称',\n",
    "    data_pair = data, #数据格式[['北京',45],['上海',20]] 或[('北京',45),('上海',20)] \n",
    ")\n",
    "# map.add_coordinate('我的家',120.11111,30.121212)  ##添加自定义经纬度  经度在前 维度在后\n",
    "\n",
    "## 系列设置\n",
    "map.set_series_opts(\n",
    "    label_opts=opts.LabelOpts(is_show=False), #去掉标识\n",
    ")\n",
    "\n",
    "## 全局设置\n",
    "map.set_global_opts(\n",
    "    visualmap_opts=opts.VisualMapOpts(is_piecewise=True,max_=200),#显示左下角的颜色控制,调节最大值为200\n",
    "    title_opts=opts.TitleOpts(title='这是标题')\n",
    ")\n",
    "map.render_notebook()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/v5/echarts.min', 'china':'https://assets.pyecharts.org/assets/v5/maps/china', 'romantic':'https://assets.pyecharts.org/assets/v5/themes/romantic'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"14301360d8914ba3a7ae77280b8b1abe\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china', 'romantic'], function(echarts) {\n",
       "                var chart_14301360d8914ba3a7ae77280b8b1abe = echarts.init(\n",
       "                    document.getElementById('14301360d8914ba3a7ae77280b8b1abe'), 'romantic', {renderer: 'canvas'});\n",
       "                var option_14301360d8914ba3a7ae77280b8b1abe = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"aria\": {\n",
       "        \"enabled\": false\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"effectScatter\",\n",
       "            \"name\": \"\\u6570\\u91cf\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"showEffectOn\": \"render\",\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            },\n",
       "            \"symbolSize\": 15,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\\u7701\",\n",
       "                    \"value\": [\n",
       "                        113.26653,\n",
       "                        23.132191,\n",
       "                        111\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\\u5e02\",\n",
       "                    \"value\": [\n",
       "                        116.4,\n",
       "                        39.9,\n",
       "                        67\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\\u5e02\",\n",
       "                    \"value\": [\n",
       "                        121.47,\n",
       "                        31.23,\n",
       "                        56\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\\u7701\",\n",
       "                    \"value\": [\n",
       "                        115.909228,\n",
       "                        28.675696,\n",
       "                        141\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\\u7701\",\n",
       "                    \"value\": [\n",
       "                        112.98381,\n",
       "                        28.112444,\n",
       "                        95\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\\u7701\",\n",
       "                    \"value\": [\n",
       "                        120.152791,\n",
       "                        30.267446,\n",
       "                        94\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\\u7701\",\n",
       "                    \"value\": [\n",
       "                        118.763232,\n",
       "                        32.061707,\n",
       "                        120\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"padding\": 5,\n",
       "                \"itemGap\": 10,\n",
       "                \"itemWidth\": 25,\n",
       "                \"itemHeight\": 14,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderColor\": \"#ccc\",\n",
       "                \"borderWidth\": 1,\n",
       "                \"borderRadius\": 0,\n",
       "                \"pageButtonItemGap\": 5,\n",
       "                \"pageButtonPosition\": \"end\",\n",
       "                \"pageFormatter\": \"{current}/{total}\",\n",
       "                \"pageIconColor\": \"#2f4554\",\n",
       "                \"pageIconInactiveColor\": \"#aaa\",\n",
       "                \"pageIconSize\": 15,\n",
       "                \"animationDurationUpdate\": 800,\n",
       "                \"selector\": false,\n",
       "                \"selectorPosition\": \"auto\",\n",
       "                \"selectorItemGap\": 7,\n",
       "                \"selectorButtonGap\": 10\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u6570\\u91cf\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u6570\\u91cf\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1,\n",
       "            \"borderRadius\": 0,\n",
       "            \"pageButtonItemGap\": 5,\n",
       "            \"pageButtonPosition\": \"end\",\n",
       "            \"pageFormatter\": \"{current}/{total}\",\n",
       "            \"pageIconColor\": \"#2f4554\",\n",
       "            \"pageIconInactiveColor\": \"#aaa\",\n",
       "            \"pageIconSize\": 15,\n",
       "            \"animationDurationUpdate\": 800,\n",
       "            \"selector\": false,\n",
       "            \"selectorPosition\": \"auto\",\n",
       "            \"selectorItemGap\": 7,\n",
       "            \"selectorButtonGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"enterable\": false,\n",
       "        \"confine\": false,\n",
       "        \"appendToBody\": false,\n",
       "        \"transitionDuration\": 0.4,\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5,\n",
       "        \"order\": \"seriesAsc\"\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"show\": \"\\u8fd9\\u662f\\u6807\\u9898\",\n",
       "            \"target\": \"blank\",\n",
       "            \"subtarget\": \"blank\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"textAlign\": \"auto\",\n",
       "            \"textVerticalAlign\": \"auto\",\n",
       "            \"triggerEvent\": false\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"piecewise\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 100,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"hoverLink\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"padding\": 5,\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 14,\n",
       "        \"borderWidth\": 0,\n",
       "        \"pieces\": [\n",
       "            {\n",
       "                \"max\": 20,\n",
       "                \"label\": \"5\\u4ee5\\u4e0b\",\n",
       "                \"color\": \"pink\"\n",
       "            },\n",
       "            {\n",
       "                \"min\": 21,\n",
       "                \"max\": 50,\n",
       "                \"label\": \"5~10\",\n",
       "                \"color\": \"yellow\"\n",
       "            },\n",
       "            {\n",
       "                \"min\": 51,\n",
       "                \"max\": 100,\n",
       "                \"label\": \"10~100\",\n",
       "                \"color\": \"red\"\n",
       "            }\n",
       "        ]\n",
       "    },\n",
       "    \"geo\": {\n",
       "        \"map\": \"china\",\n",
       "        \"roam\": true,\n",
       "        \"aspectScale\": 0.75,\n",
       "        \"nameProperty\": \"name\",\n",
       "        \"selectedMode\": false,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_14301360d8914ba3a7ae77280b8b1abe.setOption(option_14301360d8914ba3a7ae77280b8b1abe);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ea03958fa0>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.faker import Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Geo\n",
    "from pyecharts.globals import _GeoType\n",
    "\n",
    "data = [ z for z in zip(Faker.provinces,Faker.values())]\n",
    "map = Geo(init_opts=opts.InitOpts(theme=ThemeType.ROMANTIC))\n",
    "\n",
    "map.add_schema(maptype='china')\n",
    "\n",
    "map.add('数量',data,type_=_GeoType.EFFECT_SCATTER,symbol_size=15)\n",
    "\n",
    "#设置样式\n",
    "map.set_series_opts(label_opts=opts.LegendOpts(is_show=False))\n",
    "\n",
    "#自定义分段\n",
    "pieces = [\n",
    "    {'max':20,'label':'5以下','color':'pink'},\n",
    "    {'min':21,'max':50,'label':'5~10','color':'yellow'},\n",
    "    {'min':51,'max':100,'label':'10~100','color':'red'} #有下限 ，无上限\n",
    "]\n",
    "map.set_global_opts(\n",
    "    visualmap_opts=opts.VisualMapOpts(is_piecewise=True,pieces=pieces),\n",
    "    title_opts=opts.TitleOpts('这是标题')\n",
    ")\n",
    "map.render_notebook()\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  },
  "vscode": {
   "interpreter": {
    "hash": "1d5cb4465ab71eba4ee33291b0340e6efd50713e1cf30b3f6cae1a351df99746"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
